3.2.12 \(\int \frac {-2+x^2}{(1+x^2)^2} \, dx\)

Optimal. Leaf size=19 \[ -\frac {3 x}{2 \left (x^2+1\right )}-\frac {1}{2} \tan ^{-1}(x) \]

________________________________________________________________________________________

Rubi [A]  time = 0.00, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {385, 203} \begin {gather*} -\frac {3 x}{2 \left (x^2+1\right )}-\frac {1}{2} \tan ^{-1}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-2 + x^2)/(1 + x^2)^2,x]

[Out]

(-3*x)/(2*(1 + x^2)) - ArcTan[x]/2

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rubi steps

\begin {align*} \int \frac {-2+x^2}{\left (1+x^2\right )^2} \, dx &=-\frac {3 x}{2 \left (1+x^2\right )}-\frac {1}{2} \int \frac {1}{1+x^2} \, dx\\ &=-\frac {3 x}{2 \left (1+x^2\right )}-\frac {1}{2} \tan ^{-1}(x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 19, normalized size = 1.00 \begin {gather*} -\frac {3 x}{2 \left (x^2+1\right )}-\frac {1}{2} \tan ^{-1}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-2 + x^2)/(1 + x^2)^2,x]

[Out]

(-3*x)/(2*(1 + x^2)) - ArcTan[x]/2

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {-2+x^2}{\left (1+x^2\right )^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(-2 + x^2)/(1 + x^2)^2,x]

[Out]

IntegrateAlgebraic[(-2 + x^2)/(1 + x^2)^2, x]

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 21, normalized size = 1.11 \begin {gather*} -\frac {{\left (x^{2} + 1\right )} \arctan \relax (x) + 3 \, x}{2 \, {\left (x^{2} + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-2)/(x^2+1)^2,x, algorithm="fricas")

[Out]

-1/2*((x^2 + 1)*arctan(x) + 3*x)/(x^2 + 1)

________________________________________________________________________________________

giac [A]  time = 0.31, size = 15, normalized size = 0.79 \begin {gather*} -\frac {3 \, x}{2 \, {\left (x^{2} + 1\right )}} - \frac {1}{2} \, \arctan \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-2)/(x^2+1)^2,x, algorithm="giac")

[Out]

-3/2*x/(x^2 + 1) - 1/2*arctan(x)

________________________________________________________________________________________

maple [A]  time = 0.00, size = 16, normalized size = 0.84 \begin {gather*} -\frac {3 x}{2 \left (x^{2}+1\right )}-\frac {\arctan \relax (x )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-2)/(x^2+1)^2,x)

[Out]

-3/2/(x^2+1)*x-1/2*arctan(x)

________________________________________________________________________________________

maxima [A]  time = 2.34, size = 15, normalized size = 0.79 \begin {gather*} -\frac {3 \, x}{2 \, {\left (x^{2} + 1\right )}} - \frac {1}{2} \, \arctan \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-2)/(x^2+1)^2,x, algorithm="maxima")

[Out]

-3/2*x/(x^2 + 1) - 1/2*arctan(x)

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 17, normalized size = 0.89 \begin {gather*} -\frac {\mathrm {atan}\relax (x)}{2}-\frac {3\,x}{2\,\left (x^2+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 - 2)/(x^2 + 1)^2,x)

[Out]

- atan(x)/2 - (3*x)/(2*(x^2 + 1))

________________________________________________________________________________________

sympy [A]  time = 0.11, size = 15, normalized size = 0.79 \begin {gather*} - \frac {3 x}{2 x^{2} + 2} - \frac {\operatorname {atan}{\relax (x )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2-2)/(x**2+1)**2,x)

[Out]

-3*x/(2*x**2 + 2) - atan(x)/2

________________________________________________________________________________________